import request from '@/utils/request.js'
import storage from "@/utils/storage";
// 通知公告分页查询
export function noticePage(data) {
	return request.post('/api/ma/notice/page', data)
}
// 通知公告详情
export function getNoticeDetails(data) {
	return request.get(`/api/ma/notice/info?id=${data}`)
}
// 社团活动分页查询
export function activityPage(data) {
	return request.post('/api/ma/activity/page', data)
}
// 社团活动详情
export function getActivityDetails(data) {
	return request.get(`/api/ma/activity/info?id=${data}`)
}
// 入团申请
export function applyJoin(data) {
	return request.put(`/api/ma/societies/apply/join?societiesId=${data}`)
}
// 入团申请列表
export function applyList() {
	return request.get(`/api/ma/societies/apply/list`)
}
// 报名
export function activitySignUp(data) {
	return request.put(`/api/ma/activity/sign-up?activityId=${data}`)
}
// 取消报名
export function cancelSignUp(data) {
	return request.put(`/api/ma/activity/cancel/sign-up?activityId=${data}`)
}
// 获取小程序用户信息
export function myUser() {
	return request.get(`/api/auth/ma/user`)
}
// 收藏
export function collectionConfirm(data) {
	let token = storage.getToken();
    data.token=token
	return request.post('/api/ma/activity/collection/confirm', data)
}
// 取消收藏
export function collectionCancel(data) {
	let token = storage.getToken();
    data.token=token
	return request.post('/api/ma/activity/collection/cancel', data)
}
// 个人收藏列表
export function collectionList() {
	return request.get(`/api/ma/activity/collection/list`)
}
// 个人参加的活动
export function ownPage(data) {
	return request.post('/api/ma/activity/own-page', data)
}